﻿#include "sigar.h"
#include "sigar_format.h"
#include <stdio.h>
#include <windows.h>
#include <iostream>
using namespace std;

#include "sysinfo.h"
#include "cpu.h"
#include "mem.h"
#include "proc.h"


void getNetInfo()
{
    sigar_t *sigar;
    sigar_open(&sigar);

    sigar_net_info_t netinfo;
    sigar_net_info_get(sigar, &netinfo);

    sigar_net_interface_config_t ifconfig;
    sigar_net_interface_config_primary_get(sigar, &ifconfig);

    sigar_net_route_list_t routelist;
    sigar_net_route_list_get(sigar, &routelist);
    for(int i = 0; i < routelist.number; ++i)
    {
        sigar_net_route_t route = routelist.data[i];
        int a =0;
    }

    sigar_sys_info_t sysinfo;
    sigar_sys_info_get(sigar, &sysinfo);
    sigar_close(sigar);
}

void getDiskInfo()
{
    sigar_t *sigar;
    sigar_open(&sigar);

    sigar_file_system_list_t fslist;
    sigar_file_system_list_get(sigar, &fslist);
    for(unsigned long i = 0; i < fslist.number; ++i)
    {
        sigar_file_system_t disk = fslist.data[i];

        sigar_file_system_usage_t fsusage;
        sigar_file_system_usage_get(sigar,disk.dir_name, &fsusage);
        int a =0;
    }

    sigar_close(sigar);
}

int main()
{
    sysinfo m;
    m.test_sysinfo();
    return 0;
}
